#if !defined(_H_SIMULATOR)
#define _H_SIMULATOR
#include "../../game/Define/Defines.h";
#include "../../game/GameCore/CByteBuffer.h";
#include "stdio.h"
#include <Windows.h>
#define SIMULATOR_CONTAINER_STATE_SHOW	1
#define SIMULATOR_CONTAINER_STATE_HIDE	2

#define SIMULATOR_CONTAINER_TIMER_ID	1

#define SIMULATOR_CONTAINER_TXTINPUT_HWND_ID	100
#define SIMULATOR_CONTAINER_BTNOK_HWND_ID		101
#define SIMULATOR_CONTAINER_BTNCANCEL_HWND_ID	102

#define SIMULATOR Simulator::_this
class Simulator
{
public:
	static Simulator* _this;
	int Width;
	int Height;
	int MaxFPS;
	float ScrScale;

#if defined(USE_GAMEPROJECT)
#if defined(USE_OPENFEINT)
	char* OfId[ACHIEVEMENT_NUM];
	int OfPoint[ACHIEVEMENT_NUM];
#endif
#endif
//for controls
	HWND hwndParent; //handle of main window
	HINSTANCE hInstance; //instance of main window.
	HWND hwndContainer;
	HWND hwndTxtInput;
	HWND hwndBtnOk;
	HWND hwndBtnCancel;
	void initContainer(HWND parent,HINSTANCE h_instance,LPCWSTR classname);
	void correctTouch(int* x, int* y);
	~Simulator();
	int State;
	int y;
	int x;
	static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
	static Simulator* getInstance(int w, int h, float scale, int maxfps);
	void openContainer();
	void closeContainer();
	void setInputText(const char* text, int len);
	wchar_t* _current_text;
private:
	int ContainerWidth;
	bool IsLandscape;
	Simulator(int w, int h, float scale, int maxfps);
};
#endif